-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add single pool handler #94
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
[swapState.tokenIn.address, swapState.tokenOut.address, swapState.selectedChain] | ||
) | ||
const handler = useMemo(() => { | ||
if (isPoolSwap) resetSwapAmounts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here. The useMemo is about setting the swap handler and shouldn't contain other logic. If this side-effect is needed I guess it will have to go in a useEffect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, why is it needed only in the case of it being a pool swap?
Adds pool swap handler and extracts an new abstract class to share common logic.
TODO: Pool swaps in nested pools do not work cause underneath pool tokens are not valid in the swap route.